﻿Public Class Recurso
    Inherits BasePersistencia

    Private _nombre As String
    Private _apellido As String
    Private _email As String
    Private _dni As String
    Private _fechaalta As System.Nullable(Of Date)
    Private _fechabaja As System.Nullable(Of Date)
    Private _tipo As TipoRecurso = TipoRecurso.PERSONA

    Sub New()
        MyBase.Persistencia = EstadoPersistencia.INSERT
    End Sub

    Public Property Nombre() As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property
    Public Property Apellido() As String
        Get
            Return _apellido
        End Get
        Set(ByVal value As String)
            _apellido = value
        End Set
    End Property

    Public Property Email() As String
        Get
            Return _email
        End Get
        Set(ByVal value As String)
            _email = value
        End Set
    End Property

    Public ReadOnly Property FechaAlta() As System.Nullable(Of Date)
        Get
            Return _fechaalta
        End Get
    End Property

    Public ReadOnly Property FechaBaja() As System.Nullable(Of Date)
        Get
            Return _fechabaja
        End Get
    End Property

    Public Property Dni As String
        Get
            Return _dni
        End Get
        Set(value As String)
            _dni = value
        End Set
    End Property

    Public Property Tipo As TipoRecurso
        Get
            Return _tipo
        End Get
        Set(value As TipoRecurso)
            _tipo = value
        End Set
    End Property

    Public ReadOnly Property NombreCompleto As String
        Get
            Return Me.Apellido & ", " & Me.Nombre
        End Get
    End Property

    Public Overrides Function ToString() As String
        Return Me.Apellido & ", " & Me.Nombre
    End Function
End Class
